## R Code for Addtl Study, Health Care Data ##

# Load HealthCareImmigrationData.csv #
AllExps <- read.table(file.choose(), header = TRUE, sep = ",")

# Isolate health care data
AllExps$Health <- 0
AllExps$Health[!is.na(AllExps$Q33)] <- 1
AllExps$Health[!is.na(AllExps$Q31)] <- 1

Health <- AllExps[which(AllExps$Health == 1), ]

# Treat coded so that Episodic = 1, Thematic = 0
Health$Treat <- ifelse(!is.na(Health$Q31), 0, 1)

# High numbers mean more extreme
Health$Attitude <- ifelse(!is.na(Health$Q31), Health$Q31, Health$Q33)
table(Health$Attitude)
Health$HealthAgree <- ifelse(Health$Attitude < 4, 1, 0)
table(Health$HealthAgree)

Health$AttitudeEx <- abs(4 - Health$Attitude) 
table(Health$Attitude)
table(Health$AttitudeEx)
Health$AttitudeEx <- Health$AttitudeEx/3
table(Health$AttitudeEx)

# High numbers mean more important
Health$Importance <- ifelse(!is.na(Health$Q32), Health$Q32, Health$Q34)
Health$Importance <- 5 - Health$Importance
table(Health$Importance)
Health$Importance <- Health$Importance/4
table(Health$Importance)

# High numbers mean more salient
Health$Salience <- 5 - Health$Q11
table(Health$Salience)
Health$Salience <- Health$Salience/4
table(Health$Salience)

# High means more moral conviction
Health$Moral1 <- 5 - Health$Q12
Health$Moral2 <- 5 - Health$Q13
Health$MoralConv <- Health$Moral1 + Health$Moral2
table(Health$MoralConv)
Health$MoralConv <- Health$MoralConv/8
table(Health$MoralConv)

Health$Anger <- Health$Q29_1 - 1
Health$Disgust <- Health$Q29_2 - 1
Health$Sadness <- Health$Q29_3 - 1
Health$Anxiety <- Health$Q29_4 - 1

Health$AllEmo <- Health$Anger + Health$Disgust + 
  Health$Sadness + Health$Anxiety

table(Health$AllEmo)
Health$AllEmo <- Health$AllEmo/16
table(Health$AllEmo)

emodat <- c("Anger", "Disgust",
            "Sadness", "Anxiety")

emodata <- Health[emodat]

emodata <- na.omit(emodata)

# Cronbach's alpha
library(psych)
alpha(emodata) # alpha = .85

# Renaming vars
Health$HealthMoralFull <- Health$MoralConv
Health$HealthPersonalSalience <- Health$Salience
Health$HealthImportance <- Health$Importance
Health$HealthExtremity <- Health$AttitudeEx
Health$HealthTreat <- Health$Treat

# Fit Sur Model
library(systemfit)

e1 <- HealthMoralFull ~ HealthTreat
e2 <- HealthPersonalSalience ~ HealthTreat
e3 <- HealthImportance ~ HealthTreat
e4 <- HealthExtremity ~ HealthTreat

SURVars <- c("HealthMoralFull", "HealthImportance", "HealthPersonalSalience",
             "HealthExtremity", "HealthTreat")

ExpData1 <- Health[SURVars]
ExpData1 <- na.omit(ExpData1)

fitsur <- systemfit(list(Moral = e1, PerSal = e2, Imp = e3, Ext = e4), 
                    data=ExpData1)
summary(fitsur)

library(car)
rest1 <- "Moral_HealthTreat - PerSal_HealthTreat"
linearHypothesis(fitsur, rest1, test = "F")

rest2 <- "Moral_HealthTreat - Imp_HealthTreat"
linearHypothesis(fitsur, rest2, test = "F")

rest3 <- "Moral_HealthTreat - Ext_HealthTreat"
linearHypothesis(fitsur, rest3, test = "F")

## Conditional on agree/disagree (supp material)

e5 <- HealthMoralFull ~ HealthTreat*HealthAgree
e6 <- HealthPersonalSalience ~ HealthTreat*HealthAgree
e7 <- HealthImportance ~ HealthTreat*HealthAgree
e8 <- HealthExtremity ~ HealthTreat*HealthAgree

SURVars2 <- c("HealthMoralFull", "HealthImportance", "HealthPersonalSalience",
              "HealthExtremity", "HealthTreat", "HealthAgree")

ExpData2 <- Health[SURVars2]
ExpData3 <- na.omit(ExpData2)

fitsur2 <- systemfit(list(Moral = e5, PerSal = e6, Imp = e7, Ext = e8), 
                     data=ExpData3)
summary(fitsur2)

# For mediation models #
Health$AllEmo <- Health$Anger + Health$Disgust + Health$Sadness + Health$Anxiety
Health$AllEmo.2 <- Health$AllEmo/16

Health$Ind <- 0
Health$Ind[Health$Q20.1 == 3] <- 1
Health$Ind[Health$Q20.1 == 4] <- 1

Health$Dem <- 0
Health$Dem[Health$Q20.1 == 1] <- 1

Health$Rep <- 0
Health$Rep[Health$Q20.1 == 2] <- 1

table(Health$Q24)
Health$Ideol <- Health$Q24

table(Health$Q25)
Health$Female <- NA
Health$Female[Health$Q25 == 1] <- 0
Health$Female[Health$Q25 == 2] <- 1

table(Health$Q26)
Health$Age <- Health$Q26

vars <- c("MoralConv", "Treat", "Anger", "Disgust", "Sadness", "Anxiety",
          "Ind", "Dem", "Rep", "Ideol", "Female", "Age", "AllEmo", "AttitudeEx",
          "Importance", "Salience")

Health2 <- Health[vars]
Health2 <- na.omit(Health2)

Health2$HealthMoralFull <- Health2$MoralConv
Health2$HealthTreat <- Health2$Treat
Health2$HealthExtremity <- Health2$AttitudeEx
Health2$HealthPersonalSalience <- Health2$Salience
Health2$HealthImportance <- Health2$Importance
MedData <- Health2

library(mediation)

set.seed(12345)
med.fit.emo <- lm(AllEmo ~ HealthTreat + Dem + Rep + Ideol + Female + Age, 
                  data = MedData)
out.fit.emo <- lm(HealthMoralFull ~ AllEmo + HealthTreat + Dem + Rep + 
                    Ideol + Age + HealthExtremity + HealthImportance +
                    HealthPersonalSalience, data = MedData)
med.out.emo <- mediate(med.fit.emo, out.fit.emo, treat = "HealthTreat",
                       mediator = "AllEmo", robustSE = TRUE, 
                       sims = 2000)
summary(med.out.emo)

set.seed(12345)
med.fit.emo <- lm(AllEmo ~ HealthTreat + Dem + Rep + Ideol + Female + Age, 
                  data = MedData)
out.fit.emo <- lm(HealthExtremity ~ AllEmo + HealthTreat + Dem + Rep + 
                    Ideol + Age + HealthMoralFull + HealthImportance +
                    HealthPersonalSalience, data = MedData)
med.out.emo <- mediate(med.fit.emo, out.fit.emo, treat = "HealthTreat",
                       mediator = "AllEmo", robustSE = TRUE, 
                       sims = 2000)
summary(med.out.emo)

set.seed(12345)
med.fit.emo <- lm(AllEmo ~ HealthTreat + Dem + Rep + Ideol + Female + Age, 
                  data = MedData)
out.fit.emo <- lm(HealthImportance ~ AllEmo + HealthTreat + Dem + Rep + 
                    Ideol + Age + HealthExtremity + HealthMoralFull +
                    HealthPersonalSalience, data = MedData)
med.out.emo <- mediate(med.fit.emo, out.fit.emo, treat = "HealthTreat",
                       mediator = "AllEmo", robustSE = TRUE, 
                       sims = 2000)
summary(med.out.emo)

set.seed(12345)
med.fit.emo <- lm(AllEmo ~ HealthTreat + Dem + Rep + Ideol + Female + Age, 
                  data = MedData)
out.fit.emo <- lm(HealthPersonalSalience ~ AllEmo + HealthTreat + Dem + Rep + 
                    Ideol + Age + HealthExtremity + HealthImportance +
                    HealthMoralFull, data = MedData)
med.out.emo <- mediate(med.fit.emo, out.fit.emo, treat = "HealthTreat",
                       mediator = "AllEmo", robustSE = TRUE, 
                       sims = 2000)
summary(med.out.emo)

### Multiple Mediators (Supp Material) ###

MedData$HealthSalience <- MedData$HealthPersonalSalience

# Anger #
set.seed(12345)
m.med_anger_moralconv95 <- multimed(outcome = "HealthMoralFull", med.main = "Anger",
                                    med.alt = c("Disgust", "Sadness", "Anxiety"),
                                    treat = "HealthTreat",
                                    covariates = c("HealthExtremity", "HealthImportance",
                                                   "HealthSalience",
                                                   "Dem", "Rep", "Ideol", 
                                                   "Female", "Age"),
                                    data = MedData, sims = 2000,
                                    conf.level = .95)
summary(m.med_anger_moralconv95)

set.seed(12345)
m.med_anger_moralconv99 <- multimed(outcome = "HealthMoralFull", med.main = "Anger",
                                    med.alt = c("Disgust", "Sadness", "Anxiety"),
                                    treat = "HealthTreat",
                                    covariates = c("HealthExtremity", "HealthImportance",
                                                   "HealthSalience",
                                                   "Dem", "Rep", "Ideol", 
                                                   "Female", "Age"),
                                    data = MedData, sims = 2000,
                                    conf.level = .99)
summary(m.med_anger_moralconv99)

# Disgust #
set.seed(12345)
m.med_disgust_moralconv95 <- multimed(outcome = "HealthMoralFull", med.main = "Disgust",
                                      med.alt = c("Anger", "Sadness", "Anxiety"),
                                      treat = "HealthTreat",
                                      covariates = c("HealthExtremity", "HealthImportance",
                                                     "HealthSalience",
                                                     "Dem", "Rep", "Ideol", 
                                                     "Female", "Age"),
                                      data = MedData, sims = 2000,
                                      conf.level = .95)
summary(m.med_disgust_moralconv95)

set.seed(12345)
m.med_disgust_moralconv99 <- multimed(outcome = "HealthMoralFull", med.main = "Disgust",
                                      med.alt = c("Anger", "Sadness", "Anxiety"),
                                      treat = "HealthTreat",
                                      covariates = c("HealthExtremity", "HealthImportance",
                                                     "HealthSalience",
                                                     "Dem", "Rep", "Ideol", 
                                                     "Female", "Age"),
                                      data = MedData, sims = 2000,
                                      conf.level = .99)
summary(m.med_disgust_moralconv99)


# Anxiety #
set.seed(12345)
m.med_anxiety_moralconv95 <- multimed(outcome = "HealthMoralFull", med.main = "Anxiety",
                                      med.alt = c("Anger", "Sadness", "Disgust"),
                                      treat = "HealthTreat",
                                      covariates = c("HealthExtremity", "HealthImportance",
                                                     "HealthSalience",
                                                     "Dem", "Rep", "Ideol", 
                                                     "Female", "Age"),
                                      data = MedData, sims = 2000,
                                      conf.level = .95)
summary(m.med_anxiety_moralconv95)

set.seed(12345)
m.med_anxiety_moralconv99 <- multimed(outcome = "HealthMoralFull", med.main = "Anxiety",
                                      med.alt = c("Anger", "Sadness", "Disgust"),
                                      treat = "HealthTreat",
                                      covariates = c("HealthExtremity", "HealthImportance",
                                                     "HealthSalience",
                                                     "Dem", "Rep", "Ideol", 
                                                     "Female", "Age"),
                                      data = MedData, sims = 2000,
                                      conf.level = .99)
summary(m.med_anxiety_moralconv99)

# Sadness #
set.seed(12345)
m.med_sadness_moralconv95 <- multimed(outcome = "HealthMoralFull", med.main = "Sadness",
                                      med.alt = c("Anger", "Anxiety", "Disgust"),
                                      treat = "HealthTreat",
                                      covariates = c("HealthExtremity", "HealthImportance",
                                                     "HealthSalience",
                                                     "Dem", "Rep", "Ideol", 
                                                     "Female", "Age"),
                                      data = MedData, sims = 2000,
                                      conf.level = .95)
summary(m.med_sadness_moralconv95)

set.seed(12345)
m.med_sadness_moralconv99 <- multimed(outcome = "HealthMoralFull", med.main = "Sadness",
                                      med.alt = c("Anger", "Anxiety", "Disgust"),
                                      treat = "HealthTreat",
                                      covariates = c("HealthExtremity", "HealthImportance",
                                                     "HealthSalience",
                                                     "Dem", "Rep", "Ideol", 
                                                     "Female", "Age"),
                                      data = MedData, sims = 2000,
                                      conf.level = .99)
summary(m.med_sadness_moralconv99)


## Fear #
#set.seed(12345)
#m.med_fear_moralconv95 <- multimed(outcome = "HealthMoralFull", med.main = "Fear",
#                                   med.alt = c("Anger", "Anxiety", "Disgust", "Sadness"),
#                                   treat = "HealthTreat",
#                                   covariates = c("HealthExtremity", "HealthImportance",
#                                                  "HealthSalience",
#                                                  "Dem", "Rep", "Ideol", 
#                                                  "Female", "Age"),
#                                   data = MedData, sims = 2000,
#                                   conf.level = .95)
#summary(m.med_fear_moralconv95)
#
#set.seed(12345)
#m.med_fear_moralconv99 <- multimed(outcome = "HealthMoralFull", med.main = "Fear",
#                                   med.alt = c("Anger", "Anxiety", "Disgust", "Sadness"),
#                                   treat = "HealthTreat",
#                                   covariates = c("HealthExtremity", "HealthImportance",
#                                                  "HealthSalience",
#                                                  "Dem", "Rep", "Ideol", 
#                                                  "Female", "Age"),
#                                   data = MedData, sims = 2000,
#                                   conf.level = .99)
#summary(m.med_fear_moralconv99)


### Personal Salience ###

## PICK UP HERE ##

# Anger #
set.seed(12345)
m.med_anger_persal95 <- multimed(outcome = "HealthSalience", med.main = "Anger",
                                 med.alt = c("Disgust", "Sadness", "Anxiety"),
                                 treat = "HealthTreat",
                                 covariates = c("HealthExtremity", "HealthImportance",
                                                "HealthMoralFull",
                                                "Dem", "Rep", "Ideol", 
                                                "Female", "Age"),
                                 data = MedData, sims = 2000,
                                 conf.level = .95)
summary(m.med_anger_persal95)

set.seed(12345)
m.med_anger_persal99 <- multimed(outcome = "HealthSalience", med.main = "Anger",
                                 med.alt = c("Disgust", "Sadness", "Anxiety", "Fear"),
                                 treat = "HealthTreat",
                                 covariates = c("HealthExtremity", "HealthImportance",
                                                "HealthMoralFull",
                                                "Dem", "Rep", "Ideol", 
                                                "Female", "Age"),
                                 data = MedData, sims = 2000,
                                 conf.level = .99)
summary(m.med_anger_persal99)

# Disgust #
set.seed(12345)
m.med_disgust_persal95 <- multimed(outcome = "HealthSalience", med.main = "Disgust",
                                   med.alt = c("Anger", "Sadness", "Anxiety"),
                                   treat = "HealthTreat",
                                   covariates = c("HealthExtremity", "HealthImportance",
                                                  "HealthMoralFull",
                                                  "Dem", "Rep", "Ideol", 
                                                  "Female", "Age"),
                                   data = MedData, sims = 2000,
                                   conf.level = .95)
summary(m.med_disgust_persal95)

set.seed(12345)
m.med_disgust_persal99 <- multimed(outcome = "HealthSalience", med.main = "Disgust",
                                   med.alt = c("Anger", "Sadness", "Anxiety", "Fear"),
                                   treat = "HealthTreat",
                                   covariates = c("HealthExtremity", "HealthImportance",
                                                  "HealthMoralFull",
                                                  "Dem", "Rep", "Ideol", 
                                                  "Female", "Age"),
                                   data = MedData, sims = 2000,
                                   conf.level = .99)
summary(m.med_disgust_persal99)

# Anxiety #
set.seed(12345)
m.med_anxiety_persal95 <- multimed(outcome = "HealthSalience", med.main = "Anxiety",
                                   med.alt = c("Anger", "Sadness", "Disgust"),
                                   treat = "HealthTreat",
                                   covariates = c("HealthExtremity", "HealthImportance",
                                                  "HealthMoralFull",
                                                  "Dem", "Rep", "Ideol", 
                                                  "Female", "Age"),
                                   data = MedData, sims = 2000,
                                   conf.level = .95)
summary(m.med_anxiety_persal95)

set.seed(12345)
m.med_anxiety_persal99 <- multimed(outcome = "HealthSalience", med.main = "Anxiety",
                                   med.alt = c("Anger", "Sadness", "Disgust", "Fear"),
                                   treat = "HealthTreat",
                                   covariates = c("HealthExtremity", "HealthImportance",
                                                  "HealthMoralFull",
                                                  "Dem", "Rep", "Ideol", 
                                                  "Female", "Age"),
                                   data = MedData, sims = 2000,
                                   conf.level = .99)
summary(m.med_anxiety_persal99)

# Sadness #
set.seed(12345)
m.med_sadness_persal95 <- multimed(outcome = "HealthSalience", med.main = "Sadness",
                                   med.alt = c("Anger", "Anxiety", "Disgust"),
                                   treat = "HealthTreat",
                                   covariates = c("HealthExtremity", "HealthImportance",
                                                  "HealthMoralFull",
                                                  "Dem", "Rep", "Ideol", 
                                                  "Female", "Age"),
                                   data = MedData, sims = 2000,
                                   conf.level = .95)
summary(m.med_sadness_persal95)

set.seed(12345)
m.med_sadness_persal99 <- multimed(outcome = "HealthSalience", med.main = "Sadness",
                                   med.alt = c("Anger", "Anxiety", "Disgust", "Fear"),
                                   treat = "HealthTreat",
                                   covariates = c("HealthExtremity", "HealthImportance",
                                                  "HealthMoralFull",
                                                  "Dem", "Rep", "Ideol", 
                                                  "Female", "Age"),
                                   data = MedData, sims = 2000,
                                   conf.level = .99)
summary(m.med_sadness_persal99)


# Fear #
#set.seed(12345)
#m.med_fear_persal95 <- multimed(outcome = "HealthSalience", med.main = "Fear",
#                                med.alt = c("Anger", "Anxiety", "Disgust", "Sadness"),
#                                treat = "HealthTreat",
#                                covariates = c("HealthExtremity", "HealthImportance",
#                                               "HealthMoralFull",
#                                               "Dem", "Rep", "Ideol", 
#                                               "Female", "Age"),
#                                data = MedData, sims = 2000,
#                                conf.level = .95)
#summary(m.med_fear_persal95)
#
#set.seed(12345)
#m.med_fear_persal99 <- multimed(outcome = "HealthSalience", med.main = "Fear",
#                                med.alt = c("Anger", "Anxiety", "Disgust", "Sadness"),
#                                treat = "HealthTreat",
#                                covariates = c("HealthExtremity", "HealthImportance",
#                                               "HealthMoralFull",
#                                               "Dem", "Rep", "Ideol", 
#                                               "Female", "Age"),
#                                data = MedData, sims = 2000,
#                                conf.level = .99)
#summary(m.med_fear_persal99)
#

### Attitude Importance ###

# Anger #
set.seed(12345)
m.med_anger_imp95 <- multimed(outcome = "HealthImportance", med.main = "Anger",
                              med.alt = c("Disgust", "Sadness", "Anxiety"),
                              treat = "HealthTreat",
                              covariates = c("HealthExtremity", "HealthSalience",
                                             "HealthMoralFull",
                                             "Dem", "Rep", "Ideol", 
                                             "Female", "Age"),
                              data = MedData, sims = 2000,
                              conf.level = .95)
summary(m.med_anger_imp95)

set.seed(12345)
m.med_anger_imp99 <- multimed(outcome = "HealthImportance", med.main = "Anger",
                              med.alt = c("Disgust", "Sadness", "Anxiety", "Fear"),
                              treat = "HealthTreat",
                              covariates = c("HealthExtremity", "HealthSalience",
                                             "HealthMoralFull",
                                             "Dem", "Rep", "Ideol", 
                                             "Female", "Age"),
                              data = MedData, sims = 2000,
                              conf.level = .99)
summary(m.med_anger_imp99)

# Disgust #
set.seed(12345)
m.med_disgust_imp95 <- multimed(outcome = "HealthImportance", med.main = "Disgust",
                                med.alt = c("Anger", "Sadness", "Anxiety"),
                                treat = "HealthTreat",
                                covariates = c("HealthExtremity", "HealthSalience",
                                               "HealthMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .95)
summary(m.med_disgust_imp95)

set.seed(12345)
m.med_disgust_imp99 <- multimed(outcome = "HealthImportance", med.main = "Disgust",
                                med.alt = c("Anger", "Sadness", "Anxiety", "Fear"),
                                treat = "HealthTreat",
                                covariates = c("HealthExtremity", "HealthSalience",
                                               "HealthMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .99)
summary(m.med_disgust_imp99)

# Anxiety #
set.seed(12345)
m.med_anxiety_imp95 <- multimed(outcome = "HealthImportance", med.main = "Anxiety",
                                med.alt = c("Anger", "Sadness", "Disgust"),
                                treat = "HealthTreat",
                                covariates = c("HealthExtremity", "HealthSalience",
                                               "HealthMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .95)
summary(m.med_anxiety_imp95)

set.seed(12345)
m.med_anxiety_imp99 <- multimed(outcome = "HealthImportance", med.main = "Anxiety",
                                med.alt = c("Anger", "Sadness", "Disgust", "Fear"),
                                treat = "HealthTreat",
                                covariates = c("HealthExtremity", "HealthSalience",
                                               "HealthMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .99)
summary(m.med_anxiety_imp99)

# Sadness #
set.seed(12345)
m.med_sadness_imp95 <- multimed(outcome = "HealthImportance", med.main = "Sadness",
                                med.alt = c("Anger", "Anxiety", "Disgust"),
                                treat = "HealthTreat",
                                covariates = c("HealthExtremity", "HealthSalience",
                                               "HealthMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .95)
summary(m.med_sadness_imp95)

set.seed(12345)
m.med_sadness_imp99 <- multimed(outcome = "HealthImportance", med.main = "Sadness",
                                med.alt = c("Anger", "Anxiety", "Disgust", "Fear"),
                                treat = "HealthTreat",
                                covariates = c("HealthExtremity", "HealthSalience",
                                               "HealthMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .99)
summary(m.med_sadness_imp99)

# Fear #
#set.seed(12345)
#m.med_fear_imp95 <- multimed(outcome = "HealthImportance", med.main = "Fear",
#                             med.alt = c("Anger", "Anxiety", "Disgust", "Sadness"),
#                             treat = "HealthTreat",
#                             covariates = c("HealthExtremity", "HealthSalience",
#                                            "HealthMoralFull",
#                                            "Dem", "Rep", "Ideol", 
#                                            "Female", "Age"),
#                             data = MedData, sims = 2000,
#                             conf.level = .95)
#summary(m.med_fear_imp95)
#
#set.seed(12345)
#m.med_fear_imp99 <- multimed(outcome = "HealthImportance", med.main = "Fear",
#                             med.alt = c("Anger", "Anxiety", "Disgust", "Sadness"),
#                             treat = "HealthTreat",
#                             covariates = c("HealthExtremity", "HealthSalience",
#                                            "HealthMoralFull",
#                                            "Dem", "Rep", "Ideol", 
#                                            "Female", "Age"),
#                             data = MedData, sims = 2000,
#                             conf.level = .99)
#summary(m.med_fear_imp99)


# Attitude Extremity #

# Anger #
set.seed(12345)
m.med_anger_ext95 <- multimed(outcome = "HealthExtremity", med.main = "Anger",
                              med.alt = c("Disgust", "Sadness", "Anxiety"),
                              treat = "HealthTreat",
                              covariates = c("HealthImportance", "HealthSalience",
                                             "HealthMoralFull",
                                             "Dem", "Rep", "Ideol", 
                                             "Female", "Age"),
                              data = MedData, sims = 2000,
                              conf.level = .95)
summary(m.med_anger_ext95)

set.seed(12345)
m.med_anger_ext99 <- multimed(outcome = "HealthExtremity", med.main = "Anger",
                              med.alt = c("Disgust", "Sadness", "Anxiety"),
                              treat = "HealthTreat",
                              covariates = c("HealthImportance", "HealthSalience",
                                             "HealthMoralFull",
                                             "Dem", "Rep", "Ideol", 
                                             "Female", "Age"),
                              data = MedData, sims = 2000,
                              conf.level = .99)
summary(m.med_anger_ext99)

# Disgust #
set.seed(12345)
m.med_disgust_ext95 <- multimed(outcome = "HealthExtremity", med.main = "Disgust",
                                med.alt = c("Anger", "Sadness", "Anxiety"),
                                treat = "HealthTreat",
                                covariates = c("HealthImportance", "HealthSalience",
                                               "HealthMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .95)
summary(m.med_disgust_ext95)

set.seed(12345)
m.med_disgust_ext99 <- multimed(outcome = "HealthExtremity", med.main = "Disgust",
                                med.alt = c("Anger", "Sadness", "Anxiety"),
                                treat = "HealthTreat",
                                covariates = c("HealthImportance", "HealthSalience",
                                               "HealthMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .99)
summary(m.med_disgust_ext99)

# Anxiety #
set.seed(12345)
m.med_anxiety_ext95 <- multimed(outcome = "HealthExtremity", med.main = "Anxiety",
                                med.alt = c("Anger", "Sadness", "Disgust"),
                                treat = "HealthTreat",
                                covariates = c("HealthImportance", "HealthSalience",
                                               "HealthMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .95)
summary(m.med_anxiety_ext95)

set.seed(12345)
m.med_anxiety_ext99 <- multimed(outcome = "HealthExtremity", med.main = "Anxiety",
                                med.alt = c("Anger", "Sadness", "Disgust"),
                                treat = "HealthTreat",
                                covariates = c("HealthImportance", "HealthSalience",
                                               "HealthMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .99)
summary(m.med_anxiety_ext99)

# Sadness #
set.seed(12345)
m.med_sadness_ext95 <- multimed(outcome = "HealthExtremity", med.main = "Sadness",
                                med.alt = c("Anger", "Anxiety", "Disgust"),
                                treat = "HealthTreat",
                                covariates = c("HealthImportance", "HealthSalience",
                                               "HealthMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .95)
summary(m.med_sadness_ext95)

set.seed(12345)
m.med_sadness_ext99 <- multimed(outcome = "HealthExtremity", med.main = "Sadness",
                                med.alt = c("Anger", "Anxiety", "Disgust"),
                                treat = "HealthTreat",
                                covariates = c("HealthImportance", "HealthSalience",
                                               "HealthMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .99)
summary(m.med_sadness_ext99)


## Fear #
#set.seed(12345)
#m.med_fear_ext95 <- multimed(outcome = "HealthExtremity", med.main = "Fear",
#                             med.alt = c("Anger", "Anxiety", "Disgust", "Sadness"),
#                             treat = "HealthTreat",
#                             covariates = c("HealthImportance", "HealthSalience",
#                                            "HealthMoralFull",
#                                            "Dem", "Rep", "Ideol", 
#                                            "Female", "Age"),
#                             data = MedData, sims = 2000,
#                             conf.level = .95)
#summary(m.med_fear_ext95)
#
#set.seed(12345)
#m.med_fear_ext99 <- multimed(outcome = "HealthExtremity", med.main = "Fear",
#                             med.alt = c("Anger", "Anxiety", "Disgust", "Sadness"),
#                             treat = "HealthTreat",
#                             covariates = c("HealthImportance", "HealthSalience",
#                                            "HealthMoralFull",
#                                            "Dem", "Rep", "Ideol", 
#                                            "Female", "Age"),
#                             data = MedData, sims = 2000,
#                             conf.level = .99)
#summary(m.med_fear_ext99)


